#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;
const double eps = 1e-6;

string s;
double a;
int b;
void solve() {
  int mid = s.find('e');
  s[mid] = ' ';
  sscanf(s.c_str(), "%lf %d", &a, &b);
  double x = log10(a) + b;
  double x2 = log10(2);
  rep(i, 1, 10) {
    rep(j, 1, 30) {
      int c = (1 << i) - 1;
      int d = (1 << j) - 1;
      double y = log10(c) - i * x2 + d * x2;
      if (fabs(x - y) < eps) {
        cout << i - 1 << ' ' << j << endl;
        return;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

  while (cin >> s) {
    if (s == "0e0") break;
    solve();
  }
  return 0;
}